const graph = require('./common-graph')

const visited = new Set()
const dfs = (n) => {
  console.log(n)
  visited.add(n)
  graph[n].forEach(c => {
    !visited.has(c) && dfs(c)
    // if (!visited.has(c)) {
    //   dfs(c)
    // }
  })
}

dfs(2)